package cn.felord.oss;

import java.io.InputStream;

/**
 * The interface Storage.
 *
 * @author felord.cn
 * @since 2020 /8/24 19:54
 */
public interface Storage {


    /**
     * 存放对象
     *
     * @param bucketName   bucket  名称
     * @param objectName  自定义对象名称
     * @param inputStream  对象的输入流
     * @param contentType  参考http 的 MimeType 值
     * @throws Exception the exception
     */
    void putObject(String bucketName, String objectName, InputStream inputStream, String contentType) throws Exception;
    /**
     *  获取对象
     *
     * @param bucketName the bucket name
     * @param objectName the object name
     * @return the object
     */
    InputStream getObject(String bucketName, String objectName) throws Exception;
    /**
     *  获取对象的URL
     *
     * @param bucketName the bucket name
     * @param objectName the object name
     * @return the object url
     */
    String getObjectUrl(String bucketName, String objectName) throws Exception;

    /**
     * Remove object.
     *
     * @param bucketName the bucket name
     * @param objectName the object name
     */
    void removeObject(String bucketName, String objectName) throws Exception;

}
